<?php
	$css_list[0]['url'][] = './tpl/css/article.css';
	$css_list[0]['url'][] = './tpl/css/note.css';
?>
<!--{template inc/header_n}-->
<div class="main_warp">

    <div class="i_inner">
        <p style="text-align:left;">当前位置：<a href="/article.php?action=list&cate={$parentcate['cate_id']}">{$parentcate['cate_name']}</a> > <a href="/article.php?action=list&cate={$currcate['cate_id']}">{$currcate['cate_name']}</a></p>
        <div class="product_view">

            <div class="i_lefter">
                <div class="i_title">
                    {if $share_detail['anli']}
                    <b>¥ {if $share_detail['price2'] > 0}{$share_detail['price2']}{else}{$share_detail['price']}{/if}</b>
                    {/if}
                    <h3>
                        {$share_detail['title']}</h3>
                    <br class="g_clear" />
                    <div class="j_time">
                        {if $share_detail['anli']}店铺{else}作者{/if}：<a href="{if empty($share_detail['uid'])}/{else}/shopinfo.php?action=show&id={$shopinfo['id']}{/if}">{if empty($share_detail['uid'])}火锅阁{else}{$home_user['user_name']}{/if}</a>
                        {if $home_user['realname_shop']}
                        <img border="0" style="vertical-align:middle;" src="/public/medal/small/v{$home_user['v2']}.jpg"/>
                        {/if}
                        {if $share_detail['anli']}
                        {if $share_detail['price2'] > 0}
                        &nbsp;&nbsp;&nbsp;原价：{$share_detail['price']}
                        {/if}
                        {/if}
                        &nbsp;&nbsp;&nbsp;时间：<?php echo date('Y-m-d', $share_detail['create_time']); ?>
                        {if !empty($share_detail['uid'])}
                        <a w="f" href="javascript:;" class="fw ed" onclick="jubao($share_detail['id']);">举报</a>
                        {/if}
                        <a id="zai" w="f" href="javascript:;" class="fw ed" onclick="zai($share_detail['id']);" style="font-weight:bold;color:red;">赞(<span id="zai_num">{$share_detail['zai_num']}</span>)</a>
                    </div>
                    {if $share_detail['anli']}
                    <p style="padding-top:2px;">
                    {if !empty($shopinfo['telphone'])}联系电话：<span style="font-weight:bold;">{$shopinfo['telphone']}{if !empty($shopinfo['telphone2'])} {$shopinfo['telphone2']}{/if}</span>{/if}
                    {if !empty($shopinfo['mobile'])}手机号码：<span style="font-weight:bold;">{$shopinfo['mobile']}{if !empty($shopinfo['mobile2'])} {$shopinfo['mobile2']}{/if}</span>{/if}
                    </p>
                    {/if}
                </div>

                {if $share_detail['anli'] && $_FANWE['user']['user_type']==0}
                {if $orderinfo && $orderinfo['pay_mulit'] == 1}
                <p style="padding-top:10px;">
                支付进度:<span style="color:red;">
                {if $orderinfo['paystep'] == 0}
                待付30%首付款
                {elseif $orderinfo['paystep'] == 1}
                已付30%首付款
                {elseif $orderinfo['paystep'] == 2}
                已付50%中期款
                {elseif $orderinfo['paystep'] == 3}
                您已经购买过此案例
                {/if}
                </span>
                </p>
                {/if}
                <div class="btn-buy"> 
                    <!-- <a class="a" href="javascript:;" onclick="doorder({$share_detail['id']})">立即购买</a> -->
                    <a class="a" href="/article.php?action=buyinit&id={$share_detail['id']}">立即购买(支付宝)</a>
                    <a class="a" href="/article.php?action=buyinit&id={$share_detail['id']}&paytype=1">立即购买(银联)</a>
                    <a class="a" href="/article.php?action=buyinit&id={$share_detail['id']}&paytype=2">拼卡支付</a>
                    <img src="/public/v1/img/06.gif" title="提示提示" />
                    <a href="/misc.php?action=payintro">支付说明</a>
                </div>
                <img src="/public/v1/img/buytip.png" title="提示提示"/>
                <img src="/public/v1/img/mulitbuytip.png" title="提示提示"/>
                {/if}
                <p style="color: #999999;line-height: 30px;font-size:16px;padding:10px 0 0 0;">未经授权，请勿转载。</p>
                <div class="i_content">
                    
                    {$share_detail['content']}
                </div>

                {if $share_detail['anli']}
                <div class="tb-tabbar-inner-wrap">
                    <ul class="tb-tabbar">
                        <li class="selected">
                            <a class="tb-tab-anchor">累计评论</a>
                            <div class="tb-selected-indicator"></div>
                        </li>
                    </ul>
                </div>
                <div class="rate-toolbar">
                    <span class="rate-filter">
                        <input onclick="showcomment(-1)" checked name="grade" class="rate-list-all rate-radio-group"  type="radio"><label>全部({$gradeall})</label>
                        <input onclick="showcomment(0)" name="grade" class="rate-list-all rate-radio-group"  type="radio"><label>好评({$grade0})</label>
                        <!-- <input onclick="showcomment(1)" name="grade" class="rate-list-all rate-radio-group"  type="radio"><label>中评({$grade1})</label> -->
                        <input onclick="showcomment(2)" name="grade" class="rate-list-all rate-radio-group"  type="radio"><label>差评({$grade2})</label>
                    </span>
                </div>
                <div class="tb-revbd">
                    <ul id="grades" class="tb-r-comments">
                        {if !empty($comment_list)}
                        <!--{loop $comment_list $v}-->
                        <li class="tb-r-review grade-{$v['grade']}">
                            <div class="tb-r-buyer"><!--{getuser 1 0 'm' ',avt'}--></div>
                            <div class="tb-r-bd">
                            	<div class="tb-rev-item ">
                            		<div class="tb-r-cnt ">
                            		    <p>{if $v['grade'] == 0}好评{elseif $v['grade'] == 1}中评{else}差评{/if}</p>
                            			{$v['comment']}
                            		</div>
                            		<!--
                            		<div class="tb-r-act-bar">
                            			<div class="tb-r-info">
                            				<span class="tb-r-date">2015年05月11日 10:27</span>
                            			</div>
                            		</div>
                            		<div class="tb-rev-comment">
                            			<div class="tb-r-sns-comment">
                            			</div>
                            		</div>
                            		-->
                            	</div>
                            	{if !empty($v['comment2'])}
                            	<div class="tb-rev-item tb-rev-item-append">
                            		<div class="tb-r-cnt ">
                            			<span class="tb-r-label-append">[追加评论]</span>
                            			{$v['comment2']}
                            		</div>
                            		<div class="tb-rev-comment">
                            			<div class="tb-r-sns-comment">
                            			</div>
                            		</div>
                            	</div>
                            	{/if}
                            </div>
                        </li>
                        <!--{/loop}-->
                        {else}
                        <p><img src="/public/v1/img/zwpj.png"></p>
                        {/if}
                    </ul>
                </div>
                {/if}
            </div>

            <div class="i_righter">
            {if $share_detail['uid'] > 0}
            <!--{template inc/u/u_me_right}-->
            {else}
                <div class="i_rightitle">相关文章</div>
                <div class="i_hot_list">
                    <ul>
                        {if !empty($article_list)}
                        <!--{loop $article_list $v}-->
                        <li>
                            <a href="/article.php?action=show&id={$v['id']}"><img src="{$v['img']}" /></a>
                            <div class="j_info">
                                <p class="k_tt"><a href="/article.php?action=show&id={$v['id']}">{$v['title']}</a></p>
                                <!--<p class="k_name"><a href="#">陈昌业</a></p>-->
                                <p class="k_time"><span><i class="ui"></i>{$v['zai_num']}</span><?php echo date('Y-m-d H:i:s', $v['create_time']); ?></p>
                            </div>
                            <br class="g_clear" />
                        </li>
                        <!--{/loop}-->
                        {/if}
                    </ul>
                </div>
            {/if}
            </div>

            <div class="g_clear"></div>

        </div>
        
        
        <div class="i_notice">
            <div class="j_title">公告栏</div>
            <div class="j_list">
                <ul>
             <li><a href="#"><b>婚礼款项建设银行冻结监管</b></a></li>
             <li><a href="#"><b>真实新人评价（新人凭婚宴发票进行评价）</b></a></li>
             <li><a href="#"><b>没有中间商赚差价</b></a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
<!--{template inc/footer}-->
<script language="javascript" type="text/javascript" src="/public/js/My97DatePicker/WdatePicker.js"></script>
{if !$share_detail['anli']}
<script type="text/javascript" src="/public/js/TextAreaTip.js"></script>
{/if}
<script type="text/javascript">
{if $share_detail['anli']}

{else}
jQuery(function(){
	CommentInit();
});

function CommentInit()
{
	$(".note_comment .pagination a").click(function(){
		var page = $(this).attr('page');
		$.Get_Article_Comment("{$share_detail['id']}",page,'#SHARE_COMMENT_LIST_BOX',CommentInit);
		return false;
	});
}

var ttTips=textAreaTips("content");
ttTips.start();
ttTips.bind();
{/if}

function myshare() {
	if(!$.Check_Login())
		return false;

    var module = 'share';
    var action =  'save';
	var url = SITE_PATH + 'services/service.php?m=' + module + '&a=' + action;
	$.ajax({
		url: url,
		type: "POST",
		data: {
		    'module' : module,
		    'action' : action,
		    'content' : '{$share_detail['title']}',
		    'albumid' : 0,
		    'mytype' : 'article',
		    'articleid' : {$share_detail['id']},
		    'pic' : '{$share_detail['img']}'
		},
		cache:false,
		dataType: "json",
		success:function(result){
			if(result.status == 1)
			{
                alert('分享成功！');
			}
			else
			{
				if(result.error_msg)
					alert(result.error_msg);
				else
					alert(LANG.pub_share_tip1);
			}
		},
		error:function(){
			alert(LANG.pub_share_tip1);
		}
	});
}

function jubao(id) {
    {if $_FANWE['uid']}
    if(window.confirm('确定举报吗？')) {
        $.get('/article.php?action=jb&id='+id, function(s){
            alert(s);
        });
    }
    {else}
    alert('请先登陆！');
    {/if}
}

var b = true;
function zai(id) {
    {if $_FANWE['uid']}
    if(b) {
        $.get('/article.php?action=zan&id='+id, function(s){
            if(s == '1') {
                $('#zai_num').html({$share_detail['zai_num']}+1);
                b = false;
            }else if(s == '2') {
                alert('请先实名认证！');
            }
        });
    }
    {else}
    alert('请先登陆！');
    {/if}
}

function showcomment(i) {
    if(i == -1)
        $('#grades li').show();
    else {
        $('#grades li').each(function(){
            if($(this).hasClass('grade-'+i))
                $(this).show();
            else
                $(this).hide();
        });
    }
}

function pingka() {
    $.colorbox({
       href:SITE_PATH+'services/service.php?m=article&a=pingka&id={$share_detail['id']}&orderid={$orderid}',
       width:400,
       height:200
    });
}

function addplan() {
    $.colorbox({
       href:SITE_PATH+'services/service.php?m=article&a=plan&id={$share_detail['id']}&paytype={$paytype}',
       width:400,
       height:200
    });
}

{if $_GET['op'] == 'plan'}
addplan();
{/if}
{if $_GET['op'] == 'showpingka'}
pingka();
{/if}

function doorder(id) {
    $.ajax({
        'url': '/article.php?action=alipayapp',
        'data': {'id': id},
        'dataType': 'json',
        'type': 'POST',
        'success': function(data) {
            if(data.status == 0) {
                alert('已通知商家上传合同，请耐心等待');
            } else {
                alert(data.msg); 
            }
        },
        'error': function(e) {
            alert('系统繁忙，请稍候再试');
        }
    });
}
</script>
